home *** CD-ROM | disk | FTP | other *** search
/ NeXTSTEP 3.3 (Developer)…68k, x86, SPARC, PA-RISC] / NeXTSTEP 3.3 Dev Intel.iso / usr / sybase / doc / dbtabsource.man < prev    next >
Text File  |  1993-04-22  |  3KB  |  89 lines

  1.  
  2.   1                       Version 4.0 -- 5/1/89              dbtabsource
  3.   ______________________________________________________________________
  4.  
  5.   NAME:  dbtabsource
  6.  
  7.   FUNCTION:
  8.        Return the name and number of the table from which  a  particular
  9.        result column was derived.
  10.  
  11.   SYNTAX:
  12.        char *dbtabsource(dbproc, colnum, tabnum)
  13.  
  14.        DBPROCESS *dbproc;
  15.        int       colnum;
  16.        int       *tabnum;
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24.   dbtabsource             Version 4.0 -- 5/1/89                        2
  25.   ______________________________________________________________________
  26.  
  27.   COMMENTS:
  28.  
  29.        o dbtabsource() is one of the DB-Library  browse  mode  routines.
  30.          It is usable only with results from a browse-mode SELECT (i.e.,
  31.          a SELECT containing the key words FOR BROWSE).  See the  Intro-
  32.          duction for a detailed discussion of browse mode.
  33.        o dbtabsource() allows an application to determine  which  tables
  34.          provided  the  columns  in the current set of result rows. This
  35.          information is valuable when using dbqual() to construct  WHERE
  36.          clauses  for  UPDATE  and  DELETE  statements  based  on ad hoc
  37.          queries.  If the query has been  hardcoded  into  the  program,
  38.          this routine is obviously unnecessary.
  39.  
  40.        o The  application  can  call  dbtabsource()   any   time   after
  41.          dbresults().
  42.        o Example 7 in the DB-Library  Reference  Supplement  contains  a
  43.  
  44.  
  45.  
  46.   3                       Version 4.0 -- 5/1/89              dbtabsource
  47.   ______________________________________________________________________
  48.          call to dbtabsource().
  49.  
  50.   PARAMETERS:
  51.        dbproc -  A pointer to the DBPROCESS structure that provides  the
  52.            connection for a particular front-end/SQL Server process.  It
  53.            contains all the information that DB-Library uses  to  manage
  54.            communications and data between the front end and SQL Server.
  55.        colnum -  The number of the result  column  of  interest.  Column
  56.            numbers start at 1.
  57.        tabnum -  A pointer to an integer, which will be filled  in  with
  58.            the  table's number.  Many DB-Library routines that deal with
  59.            browse mode accept either a table name or a table number.  If
  60.            dbtabsource()  returns  NULL (see below), *tabnum will be set
  61.            to -1.
  62.  
  63.   RETURNS:
  64.        A pointer to the name of the table from which this result  column
  65.  
  66.  
  67.  
  68.   dbtabsource             Version 4.0 -- 5/1/89                        4
  69.   ______________________________________________________________________
  70.        was derived. A NULL return value can mean a few different things:
  71.  
  72.        o The DBPROCESS is dead or not enabled. This  is  an  error  that
  73.          will cause an application's error handler to be invoked.
  74.        o The column number is out of range.
  75.  
  76.        o The  column  is  the  result  of   an   expression,   such   as
  77.          "max(colname)".
  78.  
  79.   SEE ALSO:
  80.        dbcolbrowse, dbcolsource, dbqual, dbtabbrowse, dbtabcount, dbtab-
  81.        name, dbtsnewlen, dbtsnewval,
  82.  
  83.  
  84.  
  85.  
  86.  
  87.  
  88.  
  89.